export default {
	getData(url, data = null) {
		return new Promise((resolve, reject) => {
			uni.request({
				url: url,
				data,
				method: "GET",
				dataType: "json",
				success: (res) => {
					resolve(res.data)
				}
			})
		})
	},

	postData(url, data = null) {
		return new Promise((resolve, reject) => {
			uni.request({
				url: url,
				data,
				method: "POST",
				dataType: "json",
				success: (res) => {
					resolve(res.data)
				}
			})
		})
	},

	putData(url, data = null) {
		return new Promise((resolve, reject) => {
			uni.request({
				url: url,
				data,
				method: "PUT",
				dataType: "json",
				success: (res) => {
					resolve(res.data)
				}
			})
		})
	}
}
